#pragma once

#include "ToolkitsPro.h"

#include <string>
#include <memory>
#include <list>
#include <functional>

namespace DBX
{
    class DBXDevice;
    class TKSPRODLLEXPORT DBXDeviceFactory
    {
    public:
        virtual ~DBXDeviceFactory();

        std::string deviceType() const;
        std::string displayName() const;

        bool canCreate() const;
        std::shared_ptr<DBXDevice> create() const;

        static const std::list<DBXDeviceFactory *> allDeviceFactories();
        static DBXDeviceFactory *find(const std::string &devType);

    protected:
        DBXDeviceFactory(const std::string &devType);
        void setDisplayName(const std::string &displayName);
        void setCreator(const std::function<std::shared_ptr<DBXDevice>()> &creator);

    private:
        class Private;
        Private &p;
    };
} // namespace DBX
